package com.cfs.svc.sys;

import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Context;

import com.cfs.po.sys.Dict;
import com.cfs.po.sys.LongId;


/**
 * 级联字典
 *	
 *	@author SDZJ
 *
 */
@Path("/Cascs")
public interface CascadeService {

	/**
	 * 导入区划
	 * @return
	 */
	@GET
	@Path("/imp")
	public int imp(@Context HttpServletRequest request);


	/**
	 * 
	 * @return
	 */
	@GET
	@Path("/names")
	public Dict[] listNames();
	
	

	/**
	 * 
	 * @param name
	 * @param pk
	 * @return
	 */
	@GET
	@Path("/q/{name}/{pk}")
	public Dict getByNamePk(@PathParam("name")String name, @PathParam("pk")Integer pk);

	/**
	 * 
	 * @param name
	 * @param pk
	 * @return
	 */
	@POST
	@Path("/q/{name}")
	public Dict[] getByNamePks(@PathParam("name")String name, LongId pks);

	@DELETE
	@Path("/d/{name}")
	public int deleteByName(@PathParam("name") String name);

	@DELETE
	@Path("/d/{name}/{pk}")
	public int deleteByNamePk(@PathParam("name") String name, @PathParam("pk") int pk);

	@DELETE
	@Path("/d/{name}/{pk}/{key}")	public int deleteByNamePkKey(@PathParam("name") String name, @PathParam("pk") int pk, @PathParam("key") int key);

	@POST
	@Path("/a")
	public int addDict(Dict d);

	@PUT
	@Path("/u")
	public int updateDict(Dict d);

}
